/**
 * Requests tables or xls's of a determined dataset
 * 
 * @class NG.command.NCDDServices
 * @extends NG.command.Request
 */
NG.command.NCDDServices = Ext.extend(NG.command.Request, {
	
	method: NG.constants.NCDDServices.NCDDMethod_GetTable,
	dataset: "",
	layout: "",
	
	/**
	 * Used for obtaining xml data <br>
	 * requesting NCDD services
	 * 
	 * @return {String} formed xml structure
	 */
	getDataXML: function(){
    	var XML = new XMLWriter();
    	XML.BeginNode(NG.constants.NCDDServices.XML_NetcadWebServices);
    		XML.BeginNode(NG.constants.NCDDServices.XML_NCDD);
	        	XML.Node(NG.constants.NCDDServices.XML_NCDDMethod, this.method);
	        	XML.Node(NG.constants.NCDDServices.XML_DatasetName, this.dataset);
	        	XML.Node(NG.constants.NCDDServices.XML_LayoutName, this.layout);
	    	XML.EndNode();
    	XML.Close();
    	
    	return XML.ToString();
	},

	/**
	 * Each request class has a response <br>
	 * Response object can be obtained over related request object
	 * 
	 * @param {String} xmlData - unparsed response data according to request
	 * return {NG.response.NCDDServices} result after NCDD.NCDDServices request
	 */
	getResponse: function(xmlData){
		return new NG.response.NCDDServices({
			xmlData:xmlData
		});
	},
	
	constructor: function(config){
		config = config || {};
		config.serviceName = XSN_NETCAD_NCDDSERVICES;
		NG.command.NCDDServices.superclass.constructor.call(this, config);
	}
});